<html lang="en">
<head>
	<meta name="auto" content='spider'>
	<meta charset="UTF-8">
	<title>旅行社管理系统</title>
	<link rel="stylesheet" type="text/css" href="../css/base.css">
	<link rel="stylesheet" type="text/css" href="../css/information.css">
	<link rel="stylesheet" type="text/css" href="../css/guide.css">
	<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>

<body>

<style>
        fieldset{
            background-color: #f1f1f1;
            border: none;
            border-radius: 2px;
            margin-bottom: 12px;
            overflow: hidden;
            padding: 0 .625em;
        }

        label{
            cursor: pointer;
            display: inline-block;
            padding: 3px 6px;
            text-align: right;
            width: 150px;
            vertical-align: top;
        }

        input{
            font-size: inherit;
        }
    </style>

	<header id='header'>
		<div class='center'>
			<nav style='overflow:hidden;'>
				<!--为了大纲清晰，所以要加个标题-->
				<h2 class="none">网站导航</h2>
			<ul class="link">
					<li ><a href="index.html">首页</a></li>
					<li ><a href="tourist.html">旅客咨询</a></li>
					<li class="active"><a href="guide.html">导游查询</a></li>
					<li><a href="route_main.html">路线查询</a></li>
					<li><a href="team.html">团队查询</a></li>
				</ul>
			</nav>
		</div>
	</header>
	
	<div id="headline">
		<div class="center">
			<hgroup>
				<h2>旅行社管理系统</h2>
			</hgroup>
		</div>
	</div>
	<div id="containter">
		<aside class='sidebar'>




<div id="organ" οnclick="hideOrganDiv();">
       </div>
		</aside>
		<div class="list  airTicket">

		<h2>团队信息增加</h2>
		<hr>
			<form class="fo" action="#" method>
		<ul class="fo_city">


		<p>
            <label>团队编号:</label>
            <input type="text" id="add_team_id">
        </p>
        <p>
            <label >团队导游:</label>
            <input type="text" id="add_team_leader">
        </p>
		<p>
            
			<label>成员一姓名:</label>
            <input type="text" id="add_team_member_1"  placeholder="" />
        </p>
		<p>
            
            <label>成员二姓名:</label>
            <input type="text" id="add_team_member_2" placeholder="*可填" />
        </p>
		<p>
           
            <label>成员三姓名:</label>
            <input type="text" id="add_team_member_3" placeholder="*可填" />
           
        </p>
        
		 <p>
            <label>开始时间:</label>
			<input type="text" id="add_team_starttime">
        </p>
		 <p>
            <label>结束时间:</label>
			<input type="text" id="add_team_endtime	">
        </p>
        <p>
            <label>路线ID:</label>
			<input type="text" id="add_team_route">
        </p>
	
		</ul>

		<div class="submit">
			<button id="submit_add" style="top:130px;right:190px;">增加</button>
		</div>
			</form>
		</div>
	</div>
		<script>
		
		var btn = document.getElementById("submit_add");
    btn.onclick = function () {
    var team_id= document.getElementById("add_team_id");
	var team_leader= document.getElementById("add_team_leader");
	var team_route= document.getElementById("add_team_route");
	var team_starttime= document.getElementById("add_team_starttime");
	var team_endtime= document.getElementById("add_team_endtime");
	
	var team_member_1= document.getElementById("add_team_member_1");
	var team_member_2= document.getElementById("add_team_member_2");	
	var team_member_3= document.getElementById("add_team_member_3");	
    var memberList =[];
    var mes1=new Object();
    mes1.name=team_member_1.value
    var mes2=new Object();	
    mes2.name=team_member_2.value  
	var mes3=new Object();	
    mes3.name=team_member_3.value   
    memberList.push(mes1);
    memberList.push(mes2);
	memberList.push(mes3)
     
        $.ajax({
            // contentType:'application/json',
            // data:JSON.stringify(allData),
            type: 'post',
            url: 'http://39.108.233.68:8080/insOneTeam',
            data: {               
                id:team_id.value,
                teamnum:3,
                // //routeId不能为空！
                routeId:team_route.value,
                leaderName:team_leader.value,
				starttime:Date(team_starttime),
				endtime:Date(team_endtime),
                memberList:JSON.stringify(memberList),
            },
            success:function (data) {               
				//console.log(data);
						//alert("data:" + data);
						window.location.href = "team.html";
               
            }
        }); 
}
		</script>
<div style="height: 200px"></div>
<footer id='foot'>
    <div class="top">

        <h1>欢迎使用SUN旅行社</h1>

    </div>
    <div class="bottom">
        SUN旅行社 |  | 旅行经营许可证
    </div>
</footer>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>